﻿using AccompanyCabinet.Helper;
using AccompanyCabinet.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AccompanyCabinet.Admin
{
    public partial class TerminalDetail : Form
    {
        public TerminalDetail()
        {
            InitializeComponent();
        }

        private void TerminalDetail_Load(object sender, EventArgs e)
        {
            this.lab_devnum.Text = ConfigurationManager.AppSettings["Identity"].ToString();
            lab_devname.Text = HttpHelper.deviceInfoModel.Name;
            lab_devpritype.Text = HttpHelper.deviceInfoModel.UseTypeNo=="Fllow"? "流动版本": "固定版本";
            lab_devtype.Text = DevType(HttpHelper.deviceInfoModel.Type);
            lab_devtime.Text = HttpHelper.deviceInfoModel.ExpireTime.ToString("yyyy-MM-dd");
            lab_devaddress.Text = HttpHelper.deviceInfoModel.Address;
            lab_devboxcount.Text = HttpHelper.dBoxLists.Count.ToString();
        }
        public string DevType(string status)
        {
            switch (status)
            {
                case "One":return "一种规格";
                case "Two":return "两种规格";
                case "Three":return "三种规格";
                default:return "";
            }
        }

        private void btn_return_Click(object sender, EventArgs e)
        {
            Admin.Index index = new Index();
            this.Hide();
            index.Show();
        }
    }
}
